﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Webdiyer.WebControls.Mvc;

namespace Niunan.VideoSys.Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index(int pagesize = 12, int pageindex = 1)
        {
            DAL.VideoDAL dal = new DAL.VideoDAL();
            string cond = "1=1";
     
            int total = dal.CalcCount(cond);
            List<Model.Video> list = dal.GetListArray("*", "id desc", pagesize, pageindex, cond);
            PagedList<Model.Video> list2 = new PagedList<Model.Video>(list, pageindex, pagesize, total);
            return View(list2);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}